import request from '@/config/axios'

export interface MsgTemplateVO {
        id: number
        title: string
        content: string
        sort: number
}

// 查询消息模板列表
export const getMsgTemplatePage = async (params) => {
    return await request.get({url: `/wecom/msg-template/page`, params})
}

// 查询消息模板详情
export const getMsgTemplate = async (id: number) => {
    return await request.get({url: `/wecom/msg-template/get?id=` + id})
}

// 查询消息模板详情
export const getMsgTemplateSimpleList = async () => {
    return await request.get({url: `/wecom/msg-template/simple-list`})
}

// 新增消息模板
export const createMsgTemplate = async (data: MsgTemplateVO) => {
    return await request.post({url: `/wecom/msg-template/create`, data})
}

// 修改消息模板
export const updateMsgTemplate = async (data: MsgTemplateVO) => {
    return await request.put({url: `/wecom/msg-template/update`, data})
}

// 删除消息模板
export const deleteMsgTemplate = async (id: number) => {
    return await request.delete({url: `/wecom/msg-template/delete?id=` + id})
}

// 导出消息模板 Excel
export const exportMsgTemplate = async (params) => {
    return await request.download({url: `/wecom/msg-template/export-excel`, params})
}
